// 旋转图像

package Leetcode;

class solution_048 {
    public void rotate(int[][] matrix) {
        int length = matrix[0].length;
        for (int i = 0; i < length / 2; i++) {
            for (int j = i; j < (length - i - 1); j++) {
                int n = length - 1;
                int index = matrix[i][j];
                matrix[i][j] = matrix[n - j][i];
                matrix[n - j][i] = matrix[n - i][n - j];
                matrix[n - i][n - j] = matrix[j][n - i];
                matrix[j][n - i] = index;
            }
        }
    }
}

public class Solution048 {

}
